Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature excel enable multiple templates #592

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

Etschbeijer
Copy link
Collaborator

Closses #499

@Etschbeijer
Copy link
Collaborator Author

Enables the insertion of multiple templates at once

@Etschbeijer
Copy link
Collaborator Author

To do:
Rename worksheet instead of table

@Etschbeijer Etschbeijer marked this pull request as ready for review December 18, 2024 09:17
let content =
let switchContent = if model.ProtocolState.TemplateSelected.IsNone then selectContent() else insertContent()
let switchContent =
if model.ProtocolState.TemplatesSelected.Length > 0 && model.PageState.SidebarPage = Routing.SidebarPage.Protocol then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model.PageState.SidebarPage = Routing.SidebarPage.Protocol we are still in the widget? Why check for sidebar pagestate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, the view for the protocolsearch is left immediately, when a single template is added, without the possibility to add additional templates.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you must adjust the Msg that triggers this.

Model.PageState.SidebarPage = Routing.SidebarPage.Protocol
}
state, Cmd.ofMsg (UpdateModel nextModel)
| AddProtocol prot ->
log "AddProtocol"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

JsonExporter.Core.FileExporter.Main(model, dispatch)

| {SidebarPage = Routing.SidebarPage.ProtocolSearch } ->
| {WidgetTypes = Routing.WidgetTypes.ProtocolSearch } ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only remove this one as PageState. Instead track this view with a inner flag in ProtocolState

@@ -70,7 +70,7 @@ module Protocol =
let nextState = {
state with
TemplatesSelected = templates
WidgetTypes = Routing.WidgetTypes.ProtocolSearch
IsProtocolSearch = true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is not required, correct? As you would already be on the search screen? Remove it if it is not necessary to allow reusing this Msg in different logic approaches without switching to search view

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

| {WidgetTypes = Routing.WidgetTypes.TermSearch } ->
TermSearch.Main (model, dispatch)
if model.ProtocolState.IsProtocolSearch then
Protocol.SearchContainer.Main model dispatch
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this if-else logic into the protocol view logic, do not handle this in sidebarview anymore

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants